<!--  -->
<template>
  <div class="host-status">
    <div class="host-status-left">
      <img
        v-if="statusData"
        src="/static/image/normal.gif"
      />
      <img
        v-else
        src="/static/image/strange.gif"
      />
    </div>
    
    <div class="host-status-right">
      <!-- <div class="txt" v-for="item in options" :key="item.label">
        <span class="txt-label">{{ item.label }}</span>
        <span class="txt-value">{{ item.value }}</span>
      </div> -->
      <div class="txt">
        <span class="txt-label"
          >名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称</span
        >
        <span class="txt-value">{{ statusData.ip }}</span>
      </div>
      <div class="txt">
        <span class="txt-label">处&nbsp;&nbsp;理&nbsp;&nbsp;器</span>
        <span class="txt-value"
          >Intel(R) Xeon(R) Platinum 8269CY CPU T 3.10GHz</span
        >
        <!-- {{ statusData.cpuInfo }} -->
      </div>
      <div class="txt">
        <span class="txt-label"
          >磁&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;盘(A/B)</span
        >
        <span class="txt-value"
          >{{ statusData.diskA | filterPercent }}/{{
            statusData.diskB | filterPercent
          }}</span
        >
      </div>
      <div class="txt">
        <span class="txt-label"
          >内&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存</span
        >
        <span class="txt-value">{{ statusData.memory }}</span>
      </div>
      <div class="txt">
        <span class="txt-label"
          >网&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;络(入网/出网)</span
        >
        <span class="txt-value"
          >{{ statusData.receiveSpeed }}M/{{ statusData.transmitSpeed }}M</span
        >
      </div>
      <!-- <div class="txt">
        <span class="txt-label">免费状态</span>
        <span class="txt-value">----------------------</span>
      </div> -->
    </div>
  </div>
</template>

<script>
//这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）
//例如：import 《组件名称》 from '《组件路径》';

export default {
  //import引入的组件需要注入到对象中才能使用
  components: {},
  props: {
    statusData: {
      type: Object,
      default: {},
    },
  },
  filters: {
    filterPercent(val) {
      // return val.includes('%') ? val : `${val}%`
    },
  },
  data() {
    //这里存放数据
    return {};
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //方法集合
  methods: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
  },
  beforeCreate() {}, //生命周期 - 创建之前
  beforeMount() {}, //生命周期 - 挂载之前
  beforeUpdate() {}, //生命周期 - 更新之前
  updated() {}, //生命周期 - 更新之后
  beforeDestroy() {}, //生命周期 - 销毁之前
  destroyed() {}, //生命周期 - 销毁完成
  activated() {}, //如果页面有keep-alive缓存功能，这个函数会触发
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
.host-status {
  display: flex;
  height: 100%;
  overflow-x: auto;
  flex-direction: column;
  &-left {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
  }
  &-right {
    margin-left: 16px;
    margin-top: 24px;
    // margin-right: 0px;
    min-width: 430px;
    flex: 1;
    flex-wrap: nowrap;

    .txt {
      display: flex;
      margin-bottom: 24px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #ffffff;
      &-label {
        margin-right: 16px;
        // width: 36px;
        // letter-spacing: 10px;
      }
      // &-label {
      //   width: 65px;
      // }
      &-value {
        // width: 65px;
        color: aqua;
      }
    }
    .txt:last-child {
      margin-bottom: 24px;
    }
  }
}
</style>